import { ElMessage, ElNotification } from 'element-plus'
import router from '@/router/router';
// 消息提示
export function showElMessage(message, isRefresh = true) {
    ElMessage({
        message,
        type: 'success',
        duration: "2000",
        onClose: () => {
            if (!isRefresh) return;
            router.go(0); // 刷新当前页面
        }
    })
}

// 通知
export function showNotifyTip(message, isRefresh = true) {
    ElNotification({
        title: '提示',
        message,
        duration: 2000,
        onClose: function() {
            if (!isRefresh) return;
            router.go(0); // 刷新当前页面
        }
    })
}

// 对话框